package com.neo.sk.models

import models.Tables
import models.Tables.MoSimpleDetailRow
import org.slf4j.LoggerFactory
import slick.driver.MySQLDriver.simple._
import com.neo.sk.util.DBUtil._
/**
 * User: Huangshanqi
 * Date: 2015/7/15
 * Time: 10:43
 */
object MovieSimpleDetail {
  private final val logger = LoggerFactory.getLogger(getClass)


  def findAll  = db.withSession{
    implicit session  =>{
      Tables.MoSimpleDetail.list
    }
  }

  def insert(moSimpleDetailRow: MoSimpleDetailRow) = db.withSession{
    implicit session  =>{
      Tables.MoSimpleDetail += moSimpleDetailRow
    }
  }

  def getAllMid = db.withSession{
    implicit session => {
      Tables.MoSimpleDetail.map(_.mid).list.distinct
    }
  }
}
